package cn.enilu.flash.bean.entity.house;

import cn.enilu.flash.bean.entity.BaseEntity;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.validation.constraints.NotNull;

/**
 * @Description
 * @Author Spark
 * @Date Created in (2019/10/30 15:48)
 * @Version v1.0
 * @Modify
 **/
@Entity(name="room_info")
@Table(appliesTo = "room_info",comment = "房间")
@Data
@EntityListeners(AuditingEntityListener.class)
public class RoomInfo extends BaseEntity {
    @Column(name = "community_id", columnDefinition = "BIGINT COMMENT '社区ID'")
    @NotNull(message = "社区未关联")
    private Long communityId;

    @Column(name = "building_id", columnDefinition = "BIGINT COMMENT '大楼ID'")
    @NotNull(message = "大楼未关联")
    private Long buildingId;

    @Column(name = "code", columnDefinition = "VARCHAR(16) COMMENT '编号'")
    @NotNull(message = "编号不能为空")
    private String code;

    @Column(name = "floor", columnDefinition = "INT COMMENT '层数'")
    @NotNull(message = "层数不能为空")
    private Integer floor;

    @Column(name = "layout", columnDefinition = "VARCHAR(64) COMMENT '户型'")
    @NotNull(message = "户型不能为空")
    private String layout;

    @Column(name = "build_area", columnDefinition = "DOUBLE(8,2) COMMENT '建筑面积'")
    @NotNull(message = "建筑面积不能为空")
    private Double buildArea;

    @Column(name = "use_area", columnDefinition = "DOUBLE(8,2) COMMENT '使用面积'")
    @NotNull(message = "使用面积不能为空")
    private Double useArea;

    @Column(name = "fee_area", columnDefinition = "DOUBLE(8,2) COMMENT '收费面积'")
    @NotNull(message = "收费面积不能为空")
    private Double feeArea;

    @Column(name = "direction", columnDefinition = "VARCHAR(64) COMMENT '朝向'")
    @NotNull(message = "朝向不能为空")
    private String direction;

    @Column(name = "blank_flag", columnDefinition = "INT COMMENT '是否空房'")
    @NotNull(message = "是否空房不能为空")
    private Integer blankFlag;

    @Column(name = "has_file", columnDefinition = "INT COMMENT '是否有影像文件'")
    private int hasFile = 0;
}
